package club.zhilin.guli.service.vod.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhilin
 * @since 2022/2/18 11:16
 */
@Configuration
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class Beans {

    private final VodProperties properties;

    @Bean
    public DefaultAcsClient client() {
        String regionId = "cn-shanghai";
        return new DefaultAcsClient(DefaultProfile.getProfile(regionId, properties.getKeyId(), properties.getKeySecret()));
    }
}
